package cn.xiaobai.core.controller;

import cn.xiaobai.core.domain.dto.ToolInfoDTO;
import cn.xiaobai.core.service.ToolService;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 测试接口
 *
 * @Author yangdaji
 * @Date 2023/12/11
 * @PackageName cn.xiaobai.core.controller
 * @ClassName TestController
 */
@Tag(name = "测试接口")
@ApiSupport(author = "yangdaji")
@RestController("test")
public class TestController {


    @Autowired
    private ToolService toolService;

    /**
     * @return
     * @folder 测试接口/自定义
     */
    @Operation(summary = "获取工具信息列表")
    @RequestMapping(value = "/getInfos", method = RequestMethod.GET)
    public ResponseEntity<List<ToolInfoDTO>> getInfos() {
        return ResponseEntity.ofNullable(toolService.getAllToolInfo());
    }



}
